<?php
$start = microtime(true);

if (!ob_start("ob_gzhandler")) {
  ob_start();
}

require_once '../include/config.php';
require_once '../include/utils.class.php';
require_once '../include/orm.class.php';
require_once '../include/app.class.php';

session_name(SESSION);
session_start();

$orm = new ORM();
$sys = basename(__FILE__, '.php');
$app = new App($sys, $orm);
$app_data = $app->get_data();

$__inst = (isset($app_data->contents[$app_data->query]) && isset($app_data->contents[$app_data->query]->__inst)) ? $app_data->contents[$app_data->query]->__inst : 0;
$__iframe = (isset($app_data->contents[$app_data->query]) && isset($app_data->contents[$app_data->query]->__iframe)) ? $app_data->contents[$app_data->query]->__iframe : 0;
$__file = Utils::get_param('__file', 'index');
include '../ext/themes/' . $app_data->sys->__folder . '/index.php';
$orm->close();

$end = microtime(true);
$time = $end - $start;
//echo('script took ' . $time . ' seconds to execute.');
?>